import * as types from './ActionTypes.js';
import { createAction } from 'redux-actions';
import {fetchRequest} from '../util/fetch';

export const loginForEmail = createAction(types.LOGIN_USER_EMAIL,(data)=>{
    return fetchRequest('XzLogin/LoginE.go','POST',data);
});
export const loginForPhone = createAction(types.LOGIN_USER_PHONE,(data)=>{
    return fetchRequest('XzLogin/loginPK.go','POST',data);
});
export const loginForToken = createAction(types.LOGIN_USER_TOKEN,(data)=>{
    return fetchRequest('XzLogin/selToken.go','POST',data);
});
export const sendCode = createAction(types.LOGIN_SEND_CODE,(data)=>{
    return fetchRequest('XzLogin/loginP.go','POST',data);
});